<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Accueil extends CI_Controller {
    
	public function __construct() {
		parent::__construct();
		
		// verif connexion
		$this->load->Model('ConnexionModel');
		if (!$this->ConnexionModel->verifconnexion()) {
			redirect('/connexion/', 'refresh');
		}
	}
	
	public function index()
	{              
		$this->template->set('title', 'Acceuil');
		$this->template->set('messageContents', '');
		
		
		if($this->session->userdata('typeuser')=="1")
		{                            
			$this->template->load('layout','Accueil');  
		}
		else if($this->session->userdata('typeuser')=="2")
		{                
			$this->template->load('layout','AccueilEnseignant');        
		}
		else if($this->session->userdata('typeuser')=="3")
		{      
			$this->template->load('layout','AccueilAdministrateur');
		}
             
	}
        
}
